import { getInfo } from "../../api";
export const LOGIN_SUCCESS = "login_success";

function loginSuccess(data) {
  return {
    type: LOGIN_SUCCESS,
    data
  };
}

export function getUserInfo(openid) {
  return (dispatch) => {
    getInfo({openid: openid}).then(res => {
      dispatch(loginSuccess(res.data.data));
    });
  };
}
